/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package mx.its.dds2.ServicesSystem.Modelo;

import java.io.Serializable;
import java.math.BigDecimal;
import java.util.Date;
import javax.persistence.Basic;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.NamedQueries;
import javax.persistence.NamedQuery;
import javax.persistence.Table;
import javax.persistence.Temporal;
import javax.persistence.TemporalType;
import javax.validation.constraints.NotNull;
import javax.validation.constraints.Size;
import javax.xml.bind.annotation.XmlRootElement;

/**
 *
 * @author Carlos Asis
 */
@Entity
@Table(name = "servicedetail")
@XmlRootElement
@NamedQueries({
    @NamedQuery(name = "Servicedetail.findAll", query = "SELECT s FROM Servicedetail s"),
    @NamedQuery(name = "Servicedetail.findById", query = "SELECT s FROM Servicedetail s WHERE s.id = :id"),
    @NamedQuery(name = "Servicedetail.findByAmunt", query = "SELECT s FROM Servicedetail s WHERE s.amunt = :amunt"),
    @NamedQuery(name = "Servicedetail.findByFolio", query = "SELECT s FROM Servicedetail s WHERE s.folio = :folio"),
    @NamedQuery(name = "Servicedetail.findByDiscount", query = "SELECT s FROM Servicedetail s WHERE s.discount = :discount"),
    @NamedQuery(name = "Servicedetail.findByStatus", query = "SELECT s FROM Servicedetail s WHERE s.status = :status"),
    @NamedQuery(name = "Servicedetail.findByDescription", query = "SELECT s FROM Servicedetail s WHERE s.description = :description"),
    @NamedQuery(name = "Servicedetail.findByDate", query = "SELECT s FROM Servicedetail s WHERE s.date = :date"),
    @NamedQuery(name = "Servicedetail.findByTime", query = "SELECT s FROM Servicedetail s WHERE s.time = :time"),
    @NamedQuery(name = "Servicedetail.findByIdService", query = "SELECT s FROM Servicedetail s WHERE s.idService = :idService"),
    @NamedQuery(name = "Servicedetail.findByIdUser", query = "SELECT s FROM Servicedetail s WHERE s.idUser = :idUser")})
public class Servicedetail implements Serializable {
    private static final long serialVersionUID = 1L;
    @Id
    @GeneratedValue(strategy = GenerationType.IDENTITY)
    @Basic(optional = false)
    @Column(name = "id")
    private Integer id;
    // @Max(value=?)  @Min(value=?)//if you know range of your decimal fields consider using these annotations to enforce field validation
    @Column(name = "amunt")
    private BigDecimal amunt;
    @Size(max = 45)
    @Column(name = "folio")
    private String folio;
    @Column(name = "discount")
    private BigDecimal discount;
    @Column(name = "status")
    private Boolean status;
    @Size(max = 200)
    @Column(name = "description")
    private String description;
    @Column(name = "date")
    @Temporal(TemporalType.DATE)
    private Date date;
    @Column(name = "time")
    @Temporal(TemporalType.TIME)
    private Date time;
    @Basic(optional = false)
    @NotNull
    @Column(name = "idService")
    private int idService;
    @Basic(optional = false)
    @NotNull
    @Column(name = "idUser")
    private int idUser;

    public Servicedetail() {
    }

    public Servicedetail(Integer id) {
        this.id = id;
    }

    public Servicedetail(Integer id, int idService, int idUser) {
        this.id = id;
        this.idService = idService;
        this.idUser = idUser;
    }

    public Integer getId() {
        return id;
    }

    public void setId(Integer id) {
        this.id = id;
    }

    public BigDecimal getAmunt() {
        return amunt;
    }

    public void setAmunt(BigDecimal amunt) {
        this.amunt = amunt;
    }

    public String getFolio() {
        return folio;
    }

    public void setFolio(String folio) {
        this.folio = folio;
    }

    public BigDecimal getDiscount() {
        return discount;
    }

    public void setDiscount(BigDecimal discount) {
        this.discount = discount;
    }

    public Boolean getStatus() {
        return status;
    }

    public void setStatus(Boolean status) {
        this.status = status;
    }

    public String getDescription() {
        return description;
    }

    public void setDescription(String description) {
        this.description = description;
    }

    public Date getDate() {
        return date;
    }

    public void setDate(Date date) {
        this.date = date;
    }

    public Date getTime() {
        return time;
    }

    public void setTime(Date time) {
        this.time = time;
    }

    public int getIdService() {
        return idService;
    }

    public void setIdService(int idService) {
        this.idService = idService;
    }

    public int getIdUser() {
        return idUser;
    }

    public void setIdUser(int idUser) {
        this.idUser = idUser;
    }

    @Override
    public int hashCode() {
        int hash = 0;
        hash += (id != null ? id.hashCode() : 0);
        return hash;
    }

    @Override
    public boolean equals(Object object) {
        // TODO: Warning - this method won't work in the case the id fields are not set
        if (!(object instanceof Servicedetail)) {
            return false;
        }
        Servicedetail other = (Servicedetail) object;
        if ((this.id == null && other.id != null) || (this.id != null && !this.id.equals(other.id))) {
            return false;
        }
        return true;
    }

    @Override
    public String toString() {
        return "mx.its.dds2.ServicesSystem.Modelo.Servicedetail[ id=" + id + " ]";
    }
    
}
